<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>班级列表</title>
    <link href="<%=basePath%>css/style.css" rel="stylesheet" type="text/css"><link rel="stylesheet" href="../css/adminStyle.css" type="text/css" />
  </head>
  
  <body>
  <table>
  	<tr>
  		<td class="tdbottom">
  			<a href="<%=basePath%>admin/myClassService.do?method=addMyClass&specialtyId=${specialty.id}">添加班级</a>
  		</td>
  	</tr>
  	<tr>
    	<td class="tdbottom">
    		共${myClassCount}条记录，每页${listNumber}条
    	</td>
    </tr>
  	<tr>
  		<td>
  			  <table width="750" align="center" border="1" cellSpacing="0" cellPadding="0">
  	<tr class="tdhead">
  		<td>班级名称</td>
  		<td>所属专业</td>
        <td>开课年份</td>
        <td>学制</td>
        <td>结业状态</td>
  		<td>操作</td>
	</tr>
    <c:forEach items="${myClassList}" var="myClass" >
    	<tr >
    		<td class="tdcontent">
    		<a  href="<%=basePath %>admin/studentService.do?method=listStudent&myClassId=${myClass.id}">
    			<c:out value="${myClass.name}"/>
    		</a>
    			
    		</td>
    		<td class="tdcontent">
    			<c:out value="${specialty.name}"/>
    		</td>
            <td class="tdcontent">
    			<c:out value="${myClass.startYear}"/>
    		</td>
            <td class="tdcontent">
    			<c:out value="${myClass.lengthYear}"/>
    		</td>
            <td class="tdcontent">
            	<c:if test="${myClass.finish}">
            		以结业
            	</c:if>
    			<c:if test="${!myClass.finish}">
            		未结业 (<a href="<%=basePath%>admin/myClassService.do?method=setFinish&myClassId=${myClass.id}">设为结业</a>)            	</c:if>
    		</td>
    		<td class="tdcontent">
    			<a href="<%=basePath%>admin/myClassService.do?method=showMyClass&myClassId=${myClass.id}">编辑</a> | <a href="<%=basePath%>admin/myClassService.do?method=deleteMyClass&myClassId=${myClass.id}">删除</a>
    		</td>
    	
    	</tr>
    </c:forEach>
    <tr>
    	<td colspan="6" class="tdbottom" align="center">
    		<c:if test="${page!=1}">
    			<a href="<%=basePath%>admin/myClassService.do?method=listMyClass&page=1&specialtyId=${specialty.id}">首页</a>
    			<a href="<%=basePath%>admin/myClassService.do?method=listMyClass&page=${page-1}&specialtyId=${specialty.id}">上一页</a>
    		</c:if>
    		<c:if test="${page==1}">
    			首页 上一页
    		</c:if>
    		第<c:out value="${page}"/>/<c:out value="${pageCount}"/>页
    		<c:if test="${page!=pageCount}">
	    		<a href="<%=basePath%>admin/myClassService.do?method=listMyClass&page=${page+1}&specialtyId=${specialty.id}">下一页</a> 
	    		<a href="<%=basePath%>admin/myClassService.do?method=listMyClass&page=${pageCount}&specialtyId=${specialty.id}">尾页</a>
    		</c:if>
    		<c:if test="${page==pageCount}">
    			下一页 尾页
    		</c:if>
    	</td>
    </tr>
  </table>
	  </td>
  	</tr>
  </table>
  </body>
</html>
